package com.steptime.framework.spring.tx;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class SpringDemo2 {
	
	public static void main(String[] args) {
		//使用Spring的工厂
	    ApplicationContext applicationContext =new ClassPathXmlApplicationContext( "spring/trans.xml");
	    //通过工厂获得类
	    EmpService userDao =(EmpService)applicationContext.getBean("empService");
	    Emp emp  = new Emp();
	    emp.setUsername("zhangsan");
	    emp.setAge("22");
	    emp.setSex("男");
	    userDao.insert(emp);
	}
}
